package com.itheima.d3_method_references;

/**
 * 目标：构造器引用(理解语法)
 */
public class Test4 {
    public static void main(String[] args) {
        // 1、创建这个接口的匿名内部类对象。

        //使用lambda 简化

        //使用构造方法引用简化

    }
}

interface CreateCar {
    Car create(String name, double price);
}


class Car {
    private String name;
    private double price;

    public Car() {

    }

    public Car(String name, double price) {
        this.name = name;
        this.price = price;
    }

    //此处省略getter,setter

    @Override
    public String toString() {
        return "Car{" +
                "name='" + name + '\'' +
                ", price=" + price +
                '}';
    }
}

